package com.battle.service.controller.web;

import com.battle.pojo.param.user.EditUserParam;
import com.battle.pojo.param.warCaseStudyUser.*;
import com.battle.pojo.vo.warCaseStudyUser.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
 * web/战例研讨用户
 * 【描 述】：
 * 【环 境】：J2SE
 * 【详 细】：
 */
@RestController
@RequestMapping("/warCaseStudyUser/web")
public class WarCaseStudyUserWebController {

    private final WarCaseStudyUserService service;

    public WarCaseStudyUserWebController(WarCaseStudyUserService service) {
        this.service = service;
    }

    /**
     * 修改战例用户状态
     *
     * @param param
     */
    @PutMapping("/editUser")
    public ApiResult editUser(@RequestBody @Valid EditWarCaseStudyUserParam param) {
        service.editWarCaseStudyUser(param);
        return ApiResult.ok();
    }


    /**
     * 获取战例研讨用户列表
     *
     * @param param
     * @return
     */
    @PostMapping("/getWarCaseStudyUserList")
    public ApiResult<PageResult<GetWarCaseStudyUserListVo>> getWarCaseStudyUserList(@RequestBody GetWarCaseStudyUserListParam param) {
        PageResult<GetWarCaseStudyUserListVo> result = service.getWarCaseStudyUserList(param);
        return ApiResult.ok(result);
    }



}

